//
//  BaseNavController.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/7/21.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class BaseNavController: UINavigationController {
    

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
//        interactivePopGestureRecognizer?.isEnabled = false

        navigationBar.barTintColor = UIColor.colorWithA(r: 0, g: 169, b: 254, A: 1.0)
        
        navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white]
        
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    
    override func  pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        if childViewControllers.count > 0 {
            
            viewController.hidesBottomBarWhenPushed = true
            
        }
        
//        if viewController is GoodsClassifyController {
//            
//            viewController.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
//
//
//        } else {
        
            viewController.navigationItem.backBarButtonItem = UIBarButtonItem(title: "返回", style: .plain, target: nil, action: nil)

//        }
        

        super.pushViewController(viewController, animated: true)
        
        
    }
    
    
    
    
    
    override func popViewController(animated: Bool) -> UIViewController? {
        
        for item in viewControllers {
            if item is SettingController {
                QL1("is SettingController")
            }
        }
        
         return   super.popViewController(animated: true)
    }
    
    
    override var preferredStatusBarStyle: UIStatusBarStyle{
        
        get{
        
        return .lightContent
        
        
        }
    
    
    }
    
    
   }
